<?php
include_once "function_xml_basic.php";
include_once "function_base_xml_class.php";

class CProtocol extends base_xml_class
{
	function __construct()
	{
		$this->root_path = "/MINI/RESOURCES/OBJECTS/PROTOCOLCLASS/ATOM";
		$this->node_name = "OBJECT";
		$this->key_array = array('Name','Protocol', 'Desc',
				   	 'Apply', 'ProtocolType', 'ObjectType');
	}

}

function GetXmlBaseProtocolObjectList()
{
	$pro = new CProtocol();
	$ret_list = $pro->get_item_by_attr("ProtocolType", "1");
	return $ret_list;
}
function GetXmlExtraProtocolObjectList()
{
	$pro = new CProtocol();
	$ret_list = $pro->get_item_by_attr("ProtocolType", "2");
	return $ret_list;
}
function GetXmlFileProtocolObjectList()
{
	$pro = new CProtocol();
	$ret_list = $pro->get_item_by_attr("ProtocolType", "3");
	return $ret_list;
}



function GetXmlProtocolObjectByName($name)
{
	$root_path = "/MINI/RESOURCES/OBJECTS/PROTOCOLCLASS";
	$query_string = $root_path. "/ATOM/OBJECT[@Name='". $name. "']";
	$key_array = array('Name','Protocol', 'Desc',
			   'Apply', 'ProtocolType', 'ObjectType');
	$list = GetAttributList($query_string, $key_array);
	foreach ($list as $l)
	{
		if ($l['Name'] != '')
		{
			$ret = $l['Protocol'];
			break;
		}	
	}	
	return $ret;
}

?>
